import http from "@/api";

/**
 *  账号登录
 * @param username
 * @param password
 */
export const accountLogin = (username: string, password: string) => {
	return http.post(`/login`, { username, password });
};

export interface UserInfo {
	user: {
		id: number;
		nickName: string;
		avatar: string;
	};
}

/**
 *  获取用户信息
 * @returns
 */
export const getUserInfo = () => {
	return http.get<UserInfo>(`/getInfo`);
};
